package com.yycx.module.bus.client.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import com.yycx.common.mybatis.base.entity.AbstractEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.yycx.common.mybatis.annotation.TableAlias;

/**
 * 客户账户收支记录
 *
 * @author flyme
 * @date 2023-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("bus_custom_balance")
@TableAlias("bcb")
@ApiModel(value = "BusCustomBalance对象", description = "客户账户收支记录")
public class BusCustomBalance extends AbstractEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "customBalanceId", type = IdType.ASSIGN_ID)
    private Long customBalanceId;

    @ApiModelProperty(value = "客户ID")
    private Long customId;

    @ApiModelProperty(value = "海鹰客户ID")
    private String customCode;

    @ApiModelProperty(value = "账套ID")
    private Long companyId;

    @ApiModelProperty(value = "机构ID")
    private Long organizationId;


    @ApiModelProperty(value = "父ID")
    private Long parentId;

    @ApiModelProperty(value = "订单ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String orderId;

    @ApiModelProperty(value = "订单明细ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String orderDetailsId;

    @ApiModelProperty(value = "拆分前金额")
    private BigDecimal originalAmount;

    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "账户类型(1:货款余额,2:预收款)")
    private Integer amountType;

    @ApiModelProperty(value = "类型(1:收 2:支)")
    private Integer optType;

    @ApiModelProperty(value = "业务员")
    private Long userId;

    @ApiModelProperty(value = "交易日期")
    private Date amountDate;

    @ApiModelProperty(value = "付款银行")
    private String payBankName;

    @ApiModelProperty(value = "付款账户")
    private String payCardNo;

    @ApiModelProperty(value = "付款账户")
    private Long payBankId;

    @ApiModelProperty(value = "付款人")
    private String payUserName;

    @ApiModelProperty(value = "收款账户")
    private Long bankId;

    /**
     * 退货款ID
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long refundId;

    /**
     * 认款ID
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long rkId;

    @ApiModelProperty(value = "版本号")
    @Version
    private Integer version;

    @ApiModelProperty(value = "认款状态（0:未认款1:已认款2:已退款）")
    private Integer balanceState;

    @ApiModelProperty(value = "备注")
    private String remark;

}
